/*
 * EcDiff.h
 *
 *  Created on: 11/08/2013
 *      Author: jose
 */

#ifndef ECDIFF_H_
#define ECDIFF_H_

#include <Malla.h>

class EcDiff {
public:
	double Get_V(Malla* m, int i, int j){
		return ((((m->V(i+1,j)+m->V(i-1,j))/pow(m->Hx(),2))+((m->V(i,j+1)+m->V(i,j-1))/pow(m->Hy(),2))-FLD(i,j))/(2.0*((1/pow(m->Hx(),2))+(1/pow(m->Hy(),2)))));
	}
	double Get_E(Malla* m, int i, int j){
		return ((((m->V(i+1,j)+m->V(i-1,j))/pow(m->Hx(),2))+((m->V(i,j+1)+m->V(i,j-1))/pow(m->Hy(),2))-m->R(i,j))/(2.0*((1/pow(m->Hx(),2))+(1/pow(m->Hy(),2)))));
	}
	double FLD(int i, int j){
		return 0;
	}
	double Get_R(Malla* m, int i, int j){
		return FLD(i,j)-(((m->V(i+1,j)-2.0*m->V(i,j)+m->V(i-1,j))/(pow(m->Hx(),2)))+((m->V(i,j+1)-2.0*m->V(i,j)+m->V(i,j-1))/(pow(m->Hy(),2))));
	}
};

#endif /* ECDIFF_H_ */
